@extends('Home.home.layout')
@section('con')    
    <div class="crumb">首页 &gt; 全站搜索</div>
    <!-- <div class="main"> -->
        <!-- 搜索框 -->
        <!-- <form action="{{url('/home/home/search')}}" method="post"> -->
        <form action="{{url('/home/home/search')}}" method="post">
            <div class="pageSearchBox">
                <input type="text" name="search" style="display:block;width:585px" maxlength="20" class="searchTxt" value="{{$name}}" id="txtKeyword" onkeypress="enterKeyPress(event, btnSearch_Click)">
                <input type="button" onclick="$(this).parents('form').trigger('submit')" class="searchBtn" style="display:block;width:70px;height:40px;">
            </div>
        {{csrf_field()}}
        </form>

        <!-- 判断是否搜索有该商品 -->
        @if(!in_array($name,$res) && !empty($res))
        <div class="main">
            <div class="mt20 mb20 f14" id="divSearchKey">
                    <span>您要找的是不是:</span>
                @foreach($res as $k => $v)
                    <a href="{{url('/home/home/search',['search' => $v])}}" class="blue b mr20">{{$v}}</a>
                @endforeach
                <div class="outer">
                    <div class="wrapHead rel">
                        <span class="f14 b ml15" id="spanTopicHead">找到  “<em style="color:red">{{$name}}</em>”  相关文章 1847 条</span>
                        <a class="more mr15" id="moreTopic" style="cursor:pointer">&gt;更多</a>
                    </div>
                    <div class="flName f14" id="divTopicCount">
                        <a href="javascript:void(0);" onclick="CataClick(this)" cataid="0">全部({{$nnum}})</a>
                    @foreach($num as $k => $v)
                        <a href="javascript:void(0);" onclick="CataClick(this)" cataid="0">{{$v -> name}}({{$v -> ff}})</a>
                    @endforeach
                    </div>
                    <ul class="articleList" id="ulTopicList">
                        @foreach($news as $nk => $nv)
                            <li>   <h2><a target="_blank" href="{url('/{home/portalpost/scan',['id' => $nv -> id])}}"><span>{{$nv -> title}}</span></a></h2>   <p class="g6" style="display:inline-block;width:656px;clear:both;cursor: pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{$nv -> content}}</p>   <p class="g9"><span>{{$nv -> ctime}}</span></p></li>
                        @endforeach
                    </ul>
                </div>

                <div class="outer">
                    <div class="wrapHead rel">
                        <span class="f14 b ml15" id="spanThreadHead">找到  “<em style="color:red">黄连</em>”  相关帖子 1899 条</span>
                        <a class="more mr15" id="moreThread" style="cursor:pointer">&gt;更多</a>
                    </div>
                    <ul class="articleList" id="ulThreadList">
                        @foreach($posts as $pk => $pv)
                            <li>   <h2><a href="http://bbs.zyctd.com/thread-1038403-1-1.html" target="_blank"><span><em style="color:red">黄连</em></span></a></h2>   <p class="g6" style="display:inline-block;width:656px;clear:both;cursor: pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{$pv -> content}}</p>   <p class="g9"><span>{{$pv -> ctime}}</span></p></li>
                        @endforeach
                    </ul>
                </div>

            </div>
        </div>
        <div class="sideBar rightFg">

            
            <div class="adArea">
                
                
                <a href="http://pubsvr.zyccst.com/statistics/pop.aspx?FromID=336&amp;url=http://chaoshi.zyccst.com/product/detail/12-773255-180570-170862" target="_blank">
                    <img src="/bootcss/home/Images/9679ddef18394663a22929e7adf4a79e.jpg" alt="搜索页广告2" border="0">
                </a>
                <a href="http://pubsvr.zyccst.com/statistics/pop.aspx?FromID=337&amp;url=http://chaoshi.zyccst.com/product/detail/396-773255-165481-157658" target="_blank">
                    <img src="/bootcss/home/Images/7fe4226acb4c47a5a0b544829163598f.jpg" alt="搜索页广告3" border="0">
                </a>



            </div>
        </div>

        
        <div class="adArea">

        </div>
    
        @elseif(empty($res))
            <!-- <div style="height:20px"></div> -->
        <div class="main">
            <div class="outer">
                <div class="wrapHead rel">
                    <span class="f14 b ml15" id="spanTopicHead">找到  “<em style="color:red">{{$name}}</em>”  相关文章 0 条</span>
                    <a class="more mr15" id="moreTopic" style="cursor:pointer">&gt;更多</a>
                </div>
            </div>
            <!-- <div style="height:20px"></div> -->
            <div class="outer">
                <div class="wrapHead rel">
                    <span class="f14 b ml15" id="spanThreadHead">找到  “<em style="color:red">{{$name}}</em>”  相关帖子 0 条</span>
                    <a class="more mr15" id="moreThread" style="cursor:pointer">&gt;更多</a>
                </div>
            </div>
        </div>
        <div class="sideBar rightFg">

            
            <div class="adArea">
                
                
                <a href="http://pubsvr.zyccst.com/statistics/pop.aspx?FromID=336&amp;url=http://chaoshi.zyccst.com/product/detail/12-773255-180570-170862" target="_blank">
                    <img src="/bootcss/home/Images/9679ddef18394663a22929e7adf4a79e.jpg" alt="搜索页广告2" border="0">
                </a>
                <a href="http://pubsvr.zyccst.com/statistics/pop.aspx?FromID=337&amp;url=http://chaoshi.zyccst.com/product/detail/396-773255-165481-157658" target="_blank">
                    <img src="/bootcss/home/Images/7fe4226acb4c47a5a0b544829163598f.jpg" alt="搜索页广告3" border="0">
                </a>



            </div>
        </div>
        <div class="adArea">

        </div>
        @else
        <div class="main">
            <div class="outBd mt20" id="divPrice" style="width: 654px;">
                <div class="priceHead tr rel">
                    <a class="abs dib keyWord yahei" id="codexName" href="http://www.zyctd.com/jh282.html" target="_blank">{{$name}}</a>
                    <span class="tc f14 g9">
                        <a href="http://www.zyctd.com/jiage/xq282.html" target="_blank" class="keyInfo" id="codexPrice">{{$name}}价格</a>
                        |
                        <a href="http://ssy.zyccst.com/gy/list-282-0-1.html" target="_blank" class="keyInfo" id="codexSend">{{$name}}供求</a>
                        |
                        <a href="{{url('/home/varieties/detial',['name' => $name])}}" target="_blank" class="keyInfo" id="codexBaike">看功效</a>
                        |
                        <a href="http://search.zyccst.com/pl-5.html?Keyword={{$name}}&amp;tab=2" target="_blank" class="keyToBuy" id="nowToBuy">现在去购买</a>
                    </span>
                </div>
                <!-- 报价 -->
                <div class="priceBody clf">
                    <div class="priceIner">
                        <div class="priceInerHead rel">
                            <span class="f14">市场报价</span>
                            <a class="more" id="moreMarkePrice" href="http://www.zyctd.com/jiage/xq282.html">&gt;更多</a>
                        </div>
                        <ul class="hotBreed changeBang pb20" id="ulMarketPrice">
                            <li class="hotBreedTh">       <span class="w2">名称</span><span class="w3">规格</span><span class="w4">  市场</span><span class="w5">价格</span><span class="w1">周涨幅</span>    </li>
                        @foreach($prices as $k => $v)    
                            <li class="rq"><span class="w2"><a href="JavaScript:void(0)" title="{{$v -> mName}}">{{$v -> mName}}</a></span><span class="w3"><a href="javascript:void(0)" title="">{{$v -> size}} 重庆</a></span><span class="w4">{{$v -> market}}</span><span class="w5"><em>{{$v -> marketprice}}</em></span><span class="w1"><em class="up">0%</em></span></li>
                        @endforeach
                            <!--
                            <li class="rq"><span class="w2"><a href="JavaScript:void(0)" title="黄连">黄连</a></span><span class="w3"><a href="javascript:void(0)" title="">鸡爪统 重庆</a></span><span class="w4">玉林</span><span class="w5"><em>100.00</em></span><span class="w1"><em class="up">0%</em></span></li>
                            <li class="rq"><span class="w2"><a href="JavaScript:void(0)" title="黄连">黄连</a></span><span class="w3"><a href="javascript:void(0)" title="">鸡爪统 重庆</a></span><span class="w4">亳州</span><span class="w5"><em>100.00</em></span><span class="w1"><em class="up">0%</em></span></li>
                            <li class="rq"><span class="w2"><a href="JavaScript:void(0)" title="黄连">黄连</a></span><span class="w3"><a href="javascript:void(0)" title="">鸡爪统 重庆</a></span><span class="w4">安国</span><span class="w5"><em>95.00</em></span><span class="w1"><em class="up">0%</em></span></li>
                            -->
                        </ul>
                    </div>

                    <div class="priceIner ml14">
                        <div class="priceInerHead rel">
                            <span class="f14">产地报价</span>
                            <a class="more" id="morePlacePrice" href="http://www.zyctd.com/jiage/xq282.html">&gt;更多</a>
                        </div>
                        <ul class="hotBreed changeBang pb20" id="ulPlacePrice"><li class="hotBreedTh">       <span class="w2">名称</span><span class="w3">规格</span><span class="w4">  产区</span><span class="w5">价格</span><span class="w1">周涨幅</span>    </li>
                        @foreach($prices as $k => $v)
                            <li class="rq"><span class="w2"><a href="javascript:void()" title="{{$v -> mName}}" target="_blank">{{$v -> mName}}</a></span><span class="w3"><a href="javascript:void()" title="" target="_blank">  {{$v -> size}}  </a></span><span class="w4">{{$v -> from}}</span><span class="w5"><em>{{$v -> fromprice}}</em></span><span class="w1"><em class="up">0%</em></span></li>
                        @endforeach
                        </ul>
                    </div>
                </div>
                <!-- 新闻 -->
                <div class="outer">
                    <div class="wrapHead rel">
                        <span class="f14 b ml15" id="spanTopicHead">找到  “<em style="color:red">{{$name}}</em>”  相关文章 {{$nnum}} 条</span>
                        <a class="more mr15" href="{{url('/home/home/news',['news' => $name])}}" id="moreTopic" style="cursor:pointer">&gt;更多</a>
                    </div>
                    <div class="flName f14" id="divTopicCount">
                        <a href="javascript:void(0);" onclick="CataClick(this)" cataid="0">全部({{$nnum}})</a>
                    @foreach($num as $k => $v)
                        <a href="javascript:void(0);" onclick="CataClick(this)" cataid="0">{{$v -> name}}({{$v -> ff}})</a>
                    @endforeach
                    </div>
                    <ul class="articleList" id="ulTopicList">
                    @foreach($news as $nk => $nv)
                        <li>   <h2><a target="_blank" href="{url('/{home/portalpost/scan',['id' => $nv -> id])}}">{{$nv -> title}}</a></h2>   <p class="g6" style="display:inline-block;width:656px;clear:both;cursor: pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{$nv -> content}}</p>   <p class="g9"><span>{{$nv -> ctime}}</span></p></li>
                    @endforeach
                    </ul>
                </div>
                <!-- 帖子 -->
                <div class="outer">
                    <div class="wrapHead rel">
                        <span class="f14 b ml15" id="spanThreadHead">找到  “<em style="color:red">黄连</em>”  相关帖子 {{$pnum}} 条</span>
                        <a class="more mr15" href="{{url('/home/home/news',['news' => 1,'posts' => $name])}}" id="moreThread" style="cursor:pointer">&gt;更多</a>
                    </div>
                    <ul class="articleList" id="ulThreadList">
                    @foreach($posts as $pk => $pv)
                        <li>   <h2><a href="http://bbs.zyctd.com/thread-1038403-1-1.html" target="_blank"><span><em style="color:red">黄连</em></span></a></h2>   <p class="g6" style="display:inline-block;width:656px;clear:both;cursor: pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{$pv -> content}}</p>   <p class="g9"><span>{{$pv -> ctime}}</span></p></li>
                    @endforeach
                    </ul>
                </div>
            </div>
        </div>
            
        <div class="sideBar rightFg">

            <div class="adArea">
                               
                <a href="http://pubsvr.zyccst.com/statistics/pop.aspx?FromID=336&amp;url=http://chaoshi.zyccst.com/product/detail/12-773255-180570-170862" target="_blank">
                    <img src="/bootcss/home/Images/9679ddef18394663a22929e7adf4a79e.jpg" alt="搜索页广告2" border="0">
                </a>
                <a href="http://pubsvr.zyccst.com/statistics/pop.aspx?FromID=337&amp;url=http://chaoshi.zyccst.com/product/detail/396-773255-165481-157658" target="_blank">
                    <img src="/bootcss/home/Images/7fe4226acb4c47a5a0b544829163598f.jpg" alt="搜索页广告3" border="0">
                </a>

            </div>
        </div>

        
        <div class="adArea">

        </div>
        @endif
    
@endsection
